package com.crane.common.web.controller;

import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.crane.common.core.dto.SingleResponse;
import com.crane.oss.common.bean.request.QueryAppVersionReq;
import com.crane.oss.common.bean.resp.AppVersionResp;
import com.crane.oss.common.service.AppVersionService;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;


/**
 * @author tyh
 * @email 263998959@qq.com
 * @date 2020年11月10日 00时56分13秒
 */

@Api(value = "AppVersionController", tags = {"APP版本更新"})
@RestController
@RequestMapping("/api/appVersion")
public class AppVersionController {

    @Autowired
    AppVersionService appVersionService;


    @ApiOperation(value = "获取APP版本信息", notes = "获取APP版本信息")
    @ApiImplicitParam(name = "request", value = "请求对象", required = true, dataType = "QueryAppVersionReq")
    @RequiresPermissions("api:appversion:info")
    @PostMapping("/info")
	public SingleResponse<AppVersionResp> info(@RequestBody QueryAppVersionReq request) {
	    AppVersionResp appVersionResp = appVersionService.queryAppVersion(request);
	    return SingleResponse.of(appVersionResp);
	}

}
